package com.jeasonzhao.report.codes;

import com.jeasonzhao.commons.basic.IntegerPair;

public final class ConfigSrcTypes extends IntegerPair
{
    private static final long serialVersionUID = 1L;
    public static final ConfigSrcTypes Database = new ConfigSrcTypes(0,"database,db,dbms");
    public static final ConfigSrcTypes Directory = new ConfigSrcTypes(50,"xml,file,directory,path");
    public static final ConfigSrcTypes Hybird = new ConfigSrcTypes(80,"hybird,mix,mixed");
    public static final ConfigSrcTypes Customize = new ConfigSrcTypes(200,"customize");

    private ConfigSrcTypes(int nId,String strAlias)
    {
        super(nId,null,strAlias);
    }

    public boolean isUsingDirectory()
    {
        return this.equals(Hybird) || this.equals(Directory);
    }

    public static ConfigSrcTypes fromName(String strName)
    {
        return(ConfigSrcTypes) IntegerPair.findConstant(ConfigSrcTypes.class,strName,Directory);
    }

    public int hashCode()
    {
        return super.hashCode();
    }

    public boolean isHybird()
    {
        return this.equals(Hybird);
    }

    public boolean isCustomize()
    {
        return this.equals(Customize);
    }

    public boolean isUsingDatabase()
    {
        return this.equals(Hybird) || this.equals(Database);
    }
}
